function [CNC_swork,CNC_state,over]=updateovertime(CNC_state,CNC_swork,over,time)
    for i=1:length(over)
        if(over(i)>0)
            over(i)=over(i)-time;
        end
        if(over(i)<0)
            over(i)=0;
            CNC_state(i)=0;
            CNC_swork(i)=0;
        end
    end
end